﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace console_pictures_viewer
{
    /// <summary>
    /// Class for managing file names easily
    /// </summary>
    public class FileName
    {
        private string FullName = "";
        private string Name = "";
        private string NameWithExtension = "";
        private string FullPath = "";

        public FileName(string fullName)
        {
            FullName = fullName;
            NameWithExtension = fullName.Substring(fullName.LastIndexOf('\\') + 1);
            Name = NameWithExtension.Substring(0, NameWithExtension.LastIndexOf('.'));            
            FullPath = fullName.Substring(0, fullName.LastIndexOf('\\') + 1);
        }

        #region IFile Members

        public string GetFullName()
        {
            return FullName;
        }

        public string GetName()
        {
            return Name;
        }

        public string GetNameWithExtension()
        {
            return NameWithExtension;
        }

        public string GetFullPath()
        {
            return FullPath;
        }

        #endregion
    }
}
